﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VisualStudioProvider;
using System.Diagnostics;
using VisualStudioProvider.Templates;
using AbstraX;

namespace TestTemplateProvider
{
    class Program
    {
        static void Main(string[] args)
        {
            GeneratorExtensions.XmlTypeToDotNet("string");

            TemplateProvider.Index();

            var template = TemplateProvider.ProjectTemplates[@"\XMLManager\XMLManager"];
            var parms = new VSTemplateParameters
            {
                ProjectName = "Test",
                FrameworkVersion = "4.0",
                RegisteredOrganization = "Mind Chemistry Inc.",
                CopyrightYear = "2012"
            };

            template.CopyAndProcess(@"C:\Users\Ken\Desktop\ClassLibrary\TestProcess", parms, new List<string>() { "class1.cs" });

            var project = new VSProject(@"C:\Users\Ken\Desktop\ClassLibrary\TestProcess\XMLManager.csproj");

            project.RemoveItem((VSProjectItem)project.Items.Where(i => i.Name == "Class1.cs").Single());
            project.Save();

            //project.AddCompileFile(@"C:\Users\Ken\Desktop\ClassLibrary\TestProcess\Class2.cs", @"TestFolder\Class2.cs");
            //project.Save();

            Console.WriteLine("Finished. Press any key to exit");
            Console.ReadKey();
        }
    }
}
